package panel.downloadZipPanel
{
	import assists.Lang;
	import assists.URI;
	import assists.resource.ResourceLoader;
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.display.Stage;
	
	public class ProgressLine extends Sprite
	{
		private var _stage:Stage;
		private var _loader:ResourceLoader;
		private var _lang:Lang;
		private var _uri:URI;
		
		private var _wid:Number;
		private var _hei:Number;

		private var img:Bitmap;
		
		public function ProgressLine(stage:Stage, loader:ResourceLoader, lang:Lang, uri:URI,wid:Number,hei:Number)
		{
			_stage = stage;
			_loader = loader;
			_lang = lang;
			_uri = uri;
			
			_wid = wid;
			_hei = hei;
			
			initThis();
		}
		
		private function initThis():void
		{
			img = new _loader.uiManager.progressLine as Bitmap;
			img.width = 0;
			img.height = _hei;
			
			this.addChild(img);
		}
		
		public function changeData(num:Number):void
		{
			img.width = num * _wid;
		}
		
		public override function get height():Number
		{
			return _hei;
		}
		
		public function clear():void
		{
			if(_stage){
				_stage = null;
				_loader = null;
				_lang = null;
				_uri = null;
				
				img = null;
			}
		}
	}
}